# -*- coding: utf-8 -*-
from django.db import models
from django.db.models import permalink
from google.appengine.ext import db
import sys

class Financing(db.Model):
	"""Financing Object for RSS."""
	company_invested = db.StringProperty()
	company_invested_guid = db.StringProperty()
	date = db.StringProperty()
	currency = db.StringProperty()
	amount_raised = db.FloatProperty()
	investment_round = db.StringProperty()
	investors = db.StringProperty()
	investmentFeed = db.StringProperty()
	technologies = db.StringProperty()
	medical_focuses = db.StringProperty()
    
	def get_absolute_url(self):
		return "/company"+self.company_invested_id	
		#return 'http://cnn.com'

class FinancingTwitter(Financing):
    """Financing Object for RSS when Broadcasted by Twitter."""
    web_ref = db.StringProperty()
    
    def get_absolute_url(self):
        return "/company"+self.company_invested_id
        #if self.web_ref is None:
        #    return "http://sorry_no_ref.html"
        #else:
        #    return self.web_ref       
